package com.kakarote.core.common.enums;

import com.alibaba.nacos.shaded.com.google.common.collect.Lists;
import com.kakarote.core.common.ResultCode;

import java.util.List;

public enum ExamineLabelEnum implements ResultCode {

    OA_办公管理(0,"办公管理"),

    CRM_合同(1,"合同"),
    CRM_回款(2,"回款"),
    CRM_发票(3,"发票"),

    HRM_薪资(4,"薪资"),
    HRM_入职流程(92,"入职申请"),
    HRM_离职流程(93,"离职申请"),
    HRM_跨单位人员调动(91,"跨单位人员调动框架"),
    HRM_跨单位人员调动_调入(94,"跨单位人员调动/调入"),
    HRM_跨单位人员调动_调出(95,"跨单位人员调动/调出"),
    HRM_内部人员调动(96,"内部单位人员调动"),
    HRM_下级入职_集团审批(97,"下级入职-集团审批"),
    HRM_员工信息修改审批(98,"员工信息修改审批"),
    HRM_员工关键字段修改审批(99,"员工关键字段修改审批"),
    HRM_员工职位层级调整审批(100,"员工职位层级调整审批"),

    JXC_采购审批(5,"采购审批"),
    JXC_采购退货审批(6,"采购退货审批"),
    JXC_销售审批(7,"销售审批"),
    JXC_销售退货审批(8,"销售退货审批"),
    JXC_付款审批(9,"付款审批"),
    JXC_回款审批(10,"回款审批"),
    JXC_盘点审批(11,"盘点审批"),
    JXC_调拨审批(12,"调拨审批");

    public static List<Integer> allCode(){
        List<Integer> allCodes = Lists.newArrayList();
        for (ExamineLabelEnum value : ExamineLabelEnum.values()) {
            allCodes.add(value.getCode());
        }
        return allCodes;
    }

    public static List<Integer> getCrmCode(){
        return Lists.newArrayList(CRM_合同.getCode(),CRM_合同.getCode(),CRM_回款.getCode());
    }

    public static List<Integer> getHrmCode(){
        return Lists.newArrayList(
                HRM_薪资.getCode(),
                HRM_内部人员调动.getCode(),
                HRM_跨单位人员调动.getCode(),
                HRM_跨单位人员调动_调入.getCode(),
                HRM_跨单位人员调动_调出.getCode(),
                HRM_下级入职_集团审批.getCode(),
                HRM_入职流程.getCode(),
                HRM_员工信息修改审批.getCode(),
                HRM_员工关键字段修改审批.getCode(),
                HRM_员工职位层级调整审批.getCode(),
                HRM_离职流程.getCode());
    }


    public static List<Integer> getJxcCode(){
        return Lists.newArrayList(JXC_采购审批.getCode(),JXC_采购退货审批.getCode(),JXC_销售审批.getCode(),
                JXC_销售退货审批.getCode(),JXC_付款审批.getCode(),JXC_回款审批.getCode(), JXC_盘点审批.getCode(),JXC_调拨审批.getCode());
    }

    public static List<Integer> getOaCode(){
        return Lists.newArrayList(OA_办公管理.getCode());
    }

    ExamineLabelEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    private int code;
    private String msg;

    @Override
    public int getCode() {
        return code;
    }

    @Override
    public String getMsg() {
        return msg;
    }

    public static ExamineLabelEnum get(Integer code) {
        for (ExamineLabelEnum value : values()) {
            if (value.getCode() == code) {
                return value;
            }
        }
        return null;
    }
}
